<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://www.opensymphony.com/sitemesh/decorator" prefix="decorator" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<!doctype html>
<title><decorator:title default="欢迎使用" /></title>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>SitMesh Frame</title>
 <meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">

    <!-- Custom Fonts -->
    <link href="${pageContext.request.contextPath}/static/lib/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" >
    <link href="${pageContext.request.contextPath}/static/css/sb-admin.css" rel="stylesheet" type="text/css">
    <link href="${pageContext.request.contextPath}/static/css/plugins/morris.css" rel="stylesheet" type="text/css">
    <link href="${pageContext.request.contextPath}/static/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
   
    
	<script src="${pageContext.request.contextPath}/static/js/jquery-1.11.1.min.js"></script>
	
	
	<script src="${pageContext.request.contextPath}/static/js/bootstrap.js"></script>
	
	<script type="text/javascript" src="${pageContext.request.contextPath}/static/js/WdatePicker.js"></script>
	<script src="${pageContext.request.contextPath}/static/js/jquery.validate.min.js" type="text/javascript"></script>
	<script src="${pageContext.request.contextPath}/static/js/messages_zh.min.js" type="text/javascript"></script>

 <style>
* {
	margin: 0;
	padding: 0;
}

table, tr, td {
	text-align: center;
}
a {
	color:#999 !important;
	text-decoration: none;
}
a:hover{
	color:#999 !important;
}
</style>

<decorator:head />  
<% String name = (String)request.getSession().getAttribute("userName"); %>
<script>
	function signout(){
		if (confirm("是否确认退出？")) {
			var href="${pageContext.request.contextPath}/exam/logout";
			window.location.href=href;
			return true;
		}
		return false;
	}
	
	$(function(){
		$('#stu').collapse('show');
	})
	
	
</script>
<script>
$(function(){
	$('#stuSubject').collapse('show');
})
</script>
</head>

<body style="height:500px">
	 <div id="wrapper">
        <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
			<!-- Brand and toggle get grouped for better mobile display -->
			<div class="navbar-header">
				<button type="button" class="navbar-toggle" data-toggle="collapse"
					data-target=".navbar-ex1-collapse">
					<span class="sr-only">Toggle navigation</span> <span
						class="icon-bar"></span> <span class="icon-bar"></span> <span
						class="icon-bar"></span>
				</button>
				<a class="navbar-brand" href="${pageContext.request.contextPath}/exam/examList">在线考试系统</a>
			</div>
			<!-- Top Menu Items -->
			<ul class="nav navbar-right top-nav">
				<li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-envelope"></i> <b class="caret"></b></a>
                    <ul class="dropdown-menu message-dropdown">
                    </ul>
                </li>
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-bell"></i> <b class="caret"></b></a>
                </li>
				<li class="dropdown"><a href="#" class="dropdown-toggle"
					data-toggle="dropdown">
					<i class="fa fa-user"></i><span><strong><%=name %></strong></span><b class="caret"></b></a>
					<ul class="dropdown-menu">
						<li><a href="#"><i class="fa fa-fw fa-user"></i> 个人</a>
						</li>
						<li><a href="#"><i class="fa fa-fw fa-envelope"></i>
								信息</a></li>
						<li><a href="#"><i class="fa fa-fw fa-gear"></i> 设置</a>
						</li>
						<li class="divider"></li>
						<li style="margin:0 auto"> <span onclick="signout()"><i class="fa fa-fw fa-power-off"></i>退出</span></li>
					</ul></li>
			</ul>
			<!-- Sidebar Menu Items - These collapse to the responsive navigation menu on small screens -->
			<div class="collapse navbar-collapse navbar-ex1-collapse">
						</div>
			<!-- /.navbar-collapse -->
		</nav>

		 <div class="collapse navbar-collapse navbar-ex1-collapse">
                <ul class="nav navbar-nav side-nav">
                 <shiro:hasAnyRoles name="Teacher">
                    <li>
                        <a href="${pageContext.request.contextPath}/exam/examList"><i class="fa fa-fw fa-dashboard"></i> 学生信息管理</a>
                    </li>
                    <li>
                        <a href="${pageContext.request.contextPath}/exam/upload"><i class="fa fa-fw fa-bar-chart-o"></i> 批量上传学生信息</a>
                    </li>
                    <li>
                    	<a href="javascript:;" data-toggle="collapse" data-target="#stu"><i class="fa fa-fw fa-arrows-v"></i> 学生科目管理 <i class="fa fa-fw fa-caret-down"></i></a>
                        <ul id="stu" class="collapse" >
                            <li>
                        	<a href="${pageContext.request.contextPath}/exam/subject"><i class="fa fa-fw fa-table"></i> 学生科目</a>
                            </li>
                            <li>
                                <a href="${pageContext.request.contextPath }/exam/gradeList"><i class="fa fa-fw fa-table"></i> 学生成绩</a>
                            </li>
                            <li>
                                <a href="${pageContext.request.contextPath }/exam/questionList"><i class="fa fa-fw fa-table"></i> 学生考题</a>
                            </li>
                        </ul>
                    </li>
                    </shiro:hasAnyRoles>
                    
                    <shiro:hasAnyRoles name="Student">
                    <li>
                        <a  href="javascript:;" data-toggle="collapse" data-target="#stuSubject"><i class="fa fa-fw fa-edit"></i> 学生操作</a>
                    	 <ul id="stuSubject" class="collapse" >
                            <li>
                                <a href="${pageContext.request.contextPath }/exam/stuSubjectList"><i class="fa fa-fw fa-table"></i> 查看科目</a>
                            </li>
                            <li>
                                <a href="${pageContext.request.contextPath }/exam/stuGrade"><i class="fa fa-fw fa-table"></i> 查看成绩</a>
                            </li>
                        </ul>
                    </li>
                    </shiro:hasAnyRoles>
                    <li>
                    	<a href="${pageContext.request.contextPath}/exam/logout"><i class="fa fa-fw fa-power-off"></i>退出登录</a>
                    </li>
                    <!-- <li>
                        <a href="javascript:;" data-toggle="collapse" data-target="#demo"><i class="fa fa-fw fa-arrows-v"></i> Dropdown <i class="fa fa-fw fa-caret-down"></i></a>
                        <ul id="demo" class="collapse">
                            <li>
                                <a href="#">Dropdown Item</a>
                            </li>
                            <li>
                                <a href="#">Dropdown Item</a>
                            </li>
                        </ul>
                    </li> -->
                </ul>
            </div>
            <!-- /.navbar-collapse -->
        </nav>
         <div id="page-wrapper" style="height:620px;background-color:#fff">
			<decorator:body></decorator:body>
		</div>
	</div>
</body>
</html>